#include <cstdio>

int main( )
{
    int a, b, c, d, x, y, t = 0;
    a = b = 232; 
    c = d = -232;
    while ( scanf("%d%d", &x, &y) != EOF )
    {
        if ( x == 0 && y == 0 && t == 0 )
            break;
        if ( x == 0 && y == 0 )
        {
            printf("%d %d %d %d\n", a, b, c, d);
            a = b = 232; 
            c = d = -232;
            t = 0;
        }
        else
        {
            if ( a > x )
                a = x;
            if ( b > y )
                b = y;
            if ( c < x )
                c = x;
            if ( d < y )
                d = y;
            t++;
        }
    }
    return 0;
}
